package other;

import java.util.Scanner;

public class ScannerDemo {
	public static void main(String[] args) {
		//1.创建一个扫描仪
		Scanner scan = new Scanner(System.in);
		System.out.println("aaa");
		//可以从键盘输入8个基本类型除了char，和String
		byte nextByte = scan.nextByte();
		System.out.println(nextByte);
		short nextShort = scan.nextShort();
		System.out.println(nextShort);
		int nextInt = scan.nextInt();
		System.out.println(nextInt);
		long nextLong = scan.nextLong();
		System.out.println(nextLong);
		float nextFloat = scan.nextFloat();
		System.out.println(nextFloat);
		double nextDouble = scan.nextDouble();
		System.out.println(nextDouble);
		boolean nextBoolean = scan.nextBoolean();
		System.out.println(nextBoolean);
		// 看到空白就停止输入
		String next = scan.next();
		System.out.println(next);
		// 只看回车，输入一行
		String nextLine = scan.nextLine();
		System.out.println(nextLine);
	}
}
